var mongoose = require("mongoose");
var dbconn = require("./mongoose");

let detailsSchema=new mongoose.Schema({
  img1:{type:String},
  img2:{type:String},
  txt1:{type:String},
  txt2:{type:String},
  price:{type:String},
  img3:{type:String},
  txt3:{type:String},
  price1:{type:String},
  img4:{type:String},
  txt4:{type:String},
  price2:{type:String},
  txt5:{type:String},
  img5:{type:String},
  txt6:{type:String},
  price3:{type:String},
  txt7:{type:String},
  img6:{type:String},
  img7:{type:String}


});
let detailsModel=dbconn.model("details",detailsSchema);

module.exports = {
  "finddetail": function (cb) {
    detailsModel.find({}, function (err, data) {
      if (err) {
        console.log("查询失败");
      } else {
        cb(data);
      }
    })
  }
}
